﻿/*
 * @autor: hectorea
 * @date: 24/07/2012
 * @project: LinkedList
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LinkedList
{
    class Program
    {
        static void Main(string[] args)
        {
            //LinkedList ll = new LinkedList();
            //ll.AddLast(1);
            //ll.Display();
            //ll.AddLast(2);
            //ll.Display();
            //ll.AddLast(3);
            //ll.Display();
            //ll.AddLast(8);
            //ll.AddLast(4);
            //ll.Display();
            //ll.AddLast(9);
            //ll.Display();
            //ll.AddLast(5);
            //ll.Display();           

            //ll.GetDistinctValues();
            //ll.Display();

            LinkedList list = new LinkedList();
            list.AddFirst(1);
            list.Display();
            list.InsertAfter(2, 1);
            list.Display();
            list.InsertAfter(3, 2);
            list.Display();
            list.InsertAfter(4, 2);
            list.Display();
            list.InsertAfter(5, 4);
            list.Display();
            list.InsertAfter(6, 3);
            list.Display();
           

            //LinkedList list = new LinkedList();
            //list.InsertFirst(1);
            //list.InsertFirst(2);
            //list.InsertFirst(3);
            //list.Display(false);

            //LinkedList list = new LinkedList();

            //list.AddFirst(1);
            //list.Display();            
            //list.AddFirst(2);
            //list.InsertBefore(3, 1);
            //list.AddLast(4);
            //list.Display();
            //list.RemoveLast();
            //list.AddFirst(5);
            //list.Display();
            //list.RemoveFirst();
            //list.Display();
            //ll.Reverse();
            //list.Display();

            //LinkedList list = new LinkedList();
            //list.AddFirst(1);
            //list.Display();
            //list.InsertBefore(2, 1);
            //list.Display();
            //list.InsertBefore(3, 2);
            //list.Display();
            //list.InsertBefore(4, 3);
            //list.Display();
            //list.InsertBefore(5, 4);
            //list.Display();
            //list.InsertBefore(6, 3);
            //list.Display();

            //LinkedList list1 = new LinkedList();

            //list1.AddLast(5);
            //list1.AddLast(2);
            //list1.AddLast(9);
            //list1.AddLast(1);
            //list1.AddFirst(8);
            //list1.AddFirst(3);
            //list1.AddFirst(6);
            //list1.AddFirst(4);
            //list1.AddFirst(8);
            //list1.AddLast(7);
            //list1.AddLast(2);

            //list1.RemoveFirst();
            //list1.RemoveLast();
            //list1.Display(true);

            //list1.Reverse();
            //list1.Display(true);

            //list1.FindDuplicates();

            //list1.BubbleSort();

            //list.FindNTh(2);

            Console.Read();
        }
    }
}